package utils

import "time"

// GetCurrentWeek 获取当前周的日期范围
func GetCurrentWeek() (time.Time, time.Time) {
	now := time.Now()
	// 获取当前是周几，周日为 0，周一为 1，以此类推
	weekday := int(now.Weekday())
	if weekday == 0 {
		weekday = 7
	}
	// 计算周一的日期
	monday := now.AddDate(0, 0, -(weekday - 1))
	// 计算周日的日期
	sunday := now.AddDate(0, 0, 7-weekday)
	return monday, sunday
}
